public class _水仙花 {
    public static void main(String[] args) {
        int count = 0;
        int sum = 0;
        int figure = 153;
        int i =figure;
        while(figure != 0){
            count++;
            figure /= 10;
        }
        figure = i;
        System.out.println(count+"位数");
        while(i!=0){
            sum += Math.pow(i%10,3);
            i /=10;
        }
        System.out.println("和为"+sum);
        if(sum == figure){
            System.out.println(figure+"是水仙花数");
        }else{
            System.out.println(figure+"不是水仙花数");
        }
    }
}
